#ifndef __COMPRESS_CPU_H__
#define __COMPRESS_CPU_H__
#include"mian_util.h"
#define MAX_STR_LEN (10)
#define MAX_TITLE_LEN (200)

void cpu_RLE(uint32* data, uint32 data_len, uint32* compressed, uint32* compressed_len, uint32* compressedSize); 
void cpu_RLE(uint8* data, uint32 data_len, uint8* compressed, uint32* compressed_len, uint32* compressedSize); 
void cpu_RLE_decompression(uint8* data, uint32* data_len, uint32 dataSize, uint8* outData); 
void cpu_RLE_decompression(uint32* data, uint32* data_len, uint32 dataSize, uint32* outData); 
void cpu_delta_compress(int* dataBuffer, uint32 width, uint32 height);
void cpu_delta_decompress(int* dataBuffer, uint32 width, uint32 height);
unsigned int dictCompress(uint8* strBuffer, uint32* distinctStrCount, char* str);
char* dictDecompress(uint8* strBuffer, uint32 idx, char* str);

void golombEncode(uint32* source, uint8* dest, int M, uint32 dataSize, uint64* destBitSize);
void golombDecode(uint8* source, uint32* dest, int M, uint64 sourceBitSize);
void golombEncode(uint8* source, uint8* dest, int M, uint32 dataSize, uint64* destBitSize);
void golombDecode(uint8* source, uint8* dest, int M, uint64 sourceBitSize);

void cpu_binaryEncoding_2bit(uint8* source, uint8* dest, uint32 sourceSize, uint32* destSize);
void cpu_binaryDecoding_2bit(uint8* source, uint8* dest, uint32 sourceSize);

double getAverageRunLen(uint8* data, int len);
double getAverageRunLen(uint32* data, uint32 len); 
int countDistinct(uint8* data, int len);
uint8 abs_delta(uint8 a, uint8 b);
uint8 smaller(uint8 a, uint8 b);

#endif
